import * as API from '@/api/index.js'

export function loginByUsername(username, password) {
  const data = {
    username,
    password
  }
  return API.REQUEST({
    url: '/api-shop/admin/login/login',
    method: 'post',
    data
  })
}

export function logout() {
  return API.REQUEST({
    url: '/api-shop/admin/login/logout',
    method: 'post'
  })
}

export function getUserInfo(token) {
  return API.REQUEST({
    url: '/api-shop/admin/admin/info',
    method: 'get',
    params: { token }
  })
}

